﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Solver;

namespace SmileSolver
{
    /// <summary>
    /// Interaction logic for PuzzleControl.xaml
    /// </summary>
    public partial class PuzzleControl : UserControl
    {
        public PuzzleControl()
        {
            InitializeComponent();

            this.DataContextChanged += PuzzleControl_DataContextChanged;
        }

        SolutionCombination _solution;
        void PuzzleControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue != null)
            {
                _solution = (SolutionCombination)e.NewValue;
            }
        }

        static FrameworkPropertyMetadata propertymetadata = new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsParentArrange | FrameworkPropertyMetadataOptions.AffectsArrange, new PropertyChangedCallback(SolutionPropertyChanged));
        public static readonly DependencyProperty SolutionProperty = DependencyProperty.RegisterAttached("Solution", typeof(SolutionCombination), typeof(CardControl), propertymetadata);

        private static void SolutionPropertyChanged(DependencyObject dobj, DependencyPropertyChangedEventArgs e)
        {
            
            int a = 0;
        }

        public SolutionCombination Solution
        {
            get
            {
                return (SolutionCombination)GetValue(SolutionProperty);
            }
            set
            {
                SetValue(SolutionProperty, value);
            }
        }
    }
}
